#include<iostream>
#include<string>

using namespace std;

int main(int argc, char** argv) {
	string src[20] = {
		"abcd",
		"abcde",
		"abcdef",
		"abcdefg",
		"abcdefgh",
		"abcdefghi",
		"abcdefghij",
		"abcdefghijk",
		"abcdefghijkl",
		"abcdefghijklm",
		"abcdefghijklmn",
		"abcdefghijklmno",
		"abcdefghijklmnop",
		"abcdefghijklmnopq",
		"abcdefghijklmnopqr",
		"abcdefghijklmnopqrs",
		"abcdefghijklmnopqrst",
		"abcdefghijklmnopqrstu",
		"abcdefghijklmnopqrstuv",
		"abcdefghijklmnopqrstuvw"
	};

	int i = 0;
	while(i < 20) {
		int p = 1;
		int start = i;
		while(p < src[i].size()) {
			string substr = src[start].substr(0, p); 
			int num = 0;
			bool subok = true;

			while((start < 19) && src[start++].substr(0, p) == substr) {
				cout << "num:" << num << endl;
				num++;
				if(num > 10) {
					subok = false;
					break;
				}
			}

			if(subok) {
				break;
			}
			else {
				p++;
			}
		}
		for(int pos = i; pos < start; pos++) {
			src[pos] = src[i].substr(0, p);
		}
		i = start+1;
	}
	
	for(int i = 0; i < 20; i++) {
		cout << src[i] << endl;
	}
	return 0;
}

